﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;

using MT.eVotePRS.Device;
using MT.eVotePRS.Model;

using MT.eVotePRS.Presentation;
using MT.eVotePRS.Presentation.Logic;

namespace MT.eVotePRS.Presentation.Presenter
{
    public class RptTxnPresenter
    {
        private IViewRptTxn view;

        private ReportActions rptAction;

        public ReportActions RptAction
        {
            get { return rptAction; }
            set { rptAction = value; }
        }

        public void SetView(IViewRptTxn view)
        {
            this.view = view;
            view.GenerateReport += OnGenerateReport;
        }

        void OnGenerateReport(object sender, EventArgs e)
        {
            if (view.Report == IndividualReport.Handset)
            {
                rptAction.ShowHandsetEvents(view.TxnStatus, view.PeriodFrom, view.PeriodTo);
            }
            else if (view.Report == IndividualReport.Student)
            {
                rptAction.ShowStudentEvents(view.TxnStatus, view.PeriodFrom, view.PeriodTo);
            }
        }

        void OnViewPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
        }
    }
}
